#include<stdio.h>
void is_leap_year(int x){
	if(((x%4==0)&&(x%100!=0))||(x%400==0)){
		printf("%d\n",x);
	}
	else{
		printf("%d\n",x);
	}
}
int main(){
	int year=0;
	scanf("%d",&year);
	is_leap_year(year);
	return 0;	
}
